package com.sec.bnjey.adapter;

import java.util.ArrayList;

import com.sec.bnjey.R;
import com.sec.bnjey.vo.VOBluetoothSelectionListView;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class BluetoothSelectionAdatper extends BaseAdapter {
	private LayoutInflater mInflater;
	private Activity mActivity;
	private ArrayList<VOBluetoothSelectionListView> mBtData;
	private ViewHolder mViewHolder;

	public BluetoothSelectionAdatper(Activity activity, ArrayList<VOBluetoothSelectionListView> btdata) {
		mActivity = activity;
		mBtData = btdata;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mBtData.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		if (convertView == null) {
			mInflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView = mInflater.inflate(R.layout.bt_selection_listview_item, null);
			mViewHolder = new ViewHolder();
			mViewHolder.txtName = (TextView) convertView.findViewById(R.id.bt_listview_item_name);
			mViewHolder.txtAddrese = (TextView) convertView.findViewById(R.id.bt_listview_item_address);
			convertView.setTag(mViewHolder);
		} else {
			mViewHolder = (ViewHolder) convertView.getTag();
		}

		return null;
	}

	static class ViewHolder {
		TextView txtName;
		TextView txtAddrese;
	}
}
